Φορτώνει, μη φορτώνεις...

ΕΠΙΣΤΡΟΦΗ

Υλοποίηση μέσω γλώσσας Wolfram στο WLJS Notebook .

Απεικόνιση 3D στο επίπεδο

Επειδή το WLJS δεν υποστηρίζει όλα τα `PlotTheme` του Mathematica, υπάρχει η λύση του `MMAView` για όσους δουλεύουν στο WLJS. Συγκεκριμένα, ενώ επί παραδείγματι το παρακάτω δεν εμφάνιζε κάτι: `Plot[f[x], {x, -8, 8}, PlotTheme -> "Marketing"]` γράφοντας τελικά: `Plot[f[x], {x, -8, 8}, PlotTheme -> "Marketing"]//MMAView` εμφανίζεται το γράφημα όπως ακριβώς το παράγει το Mathematica. Για να μην προκύψουν παρανοήσεις σχετικά με τις εντολές της γλώσσας Wolfram, θα εφαρμόσουμε καθολικά το `MMAView`. Unprotect[Graphics3D]; Graphics3D /: MMAView[Graphics3D[args__, opts: OptionsPattern[] ] ] = .; Unprotect[ToString]; ToString[expr: _[__], StandardForm] := With[{view = MMAView[expr]}, ExportString[ StringReplace[ (view // ToBoxes) /. {RowBox->RowBoxFlatten} // ToString , {"\[NoBreak]"->""}] , "String"]]; Protect[ToString]; Clear["Global`*"] f[x_, y_] := x^2 - 2 y^2

Ισοϋψείς

arithmosIsoypson = 10; ContourPlot[f[x, y], {x, -5, 5}, {y, -3, 3}, PlotLegends -> Automatic, Contours -> arithmosIsoypson]

Γράφημα πυκνότητας

DensityPlot[f[x, y], {x, -5, 5}, {y, -3, 3}, PlotLegends -> Automatic] DensityPlot[f[x, y], {x, -5, 5}, {y, -3, 3}, PlotLegends -> Automatic, ColorFunction -> "SunsetColors"] DensityPlot[f[x, y], {x, -5, 5}, {y, -3, 3}, PlotLegends -> Automatic, ColorFunction -> "SunsetColors",LightingAngle -> 180*Degree]

Συνδυασμός 3D με 2D

Clear["Global`*"] zContour = -8; zMax = 2; x1 = -1; x2 = 1; y1 = -1; y2 = 1; f[x_, y_] := Sin[2 Pi x^3] + Cos[3 Pi y^2] Show[Plot3D[f[x, y], {x, x1, x2}, {y, y1, y2}, PlotStyle -> Opacity[0.7], PlotRange -> {Automatic, Automatic, {zContour, zMax}}], Graphics3D[ ContourPlot[f[x, y], {x, x1, x2}, {y, y1, y2}, Axes -> False][[1]] /. {x : _Real, y : _Real} -> {x, y, zContour}], ViewPoint -> {-2, -2, 1}, ImageSize -> 300 ]

Κώστας Κούδας | © 2025